home *** CD-ROM | disk | FTP | other *** search
/ Champak 128 / Vol 128 (Damaged).iso / games / chatnoir.swf / scripts / DefineSprite_33 / frame_12 / DoAction.as
Encoding:
Text File  |  2011-03-26  |  863 b   |  59 lines

  1. i = 0;
  2. while(i < ymax)
  3. {
  4.    j = 0;
  5.    while(j < xmax)
  6.    {
  7.       cel[i][j].reach = 0;
  8.       cel[i][j].po = -1;
  9.       j++;
  10.    }
  11.    i++;
  12. }
  13. i = 0;
  14. while(i < ymax)
  15. {
  16.    j = 0;
  17.    while(j < xmax)
  18.    {
  19.       if(cel[i][j].stat == 1)
  20.       {
  21.          k = 0;
  22.          while(k < 6)
  23.          {
  24.             var nx = !(i % 2) ? j + addx0[k] : j + addx1[k];
  25.             var ny = i + addy0[k];
  26.             if(cel[ny][nx].win)
  27.             {
  28.                cel[i][j].reach = cel[i][j].reach + 1;
  29.             }
  30.             k++;
  31.          }
  32.       }
  33.       j++;
  34.    }
  35.    i++;
  36. }
  37. f = 0;
  38. if(go_out() == 0)
  39. {
  40.    if(goto_win() == 0)
  41.    {
  42.       if(get_nearest() == 0)
  43.       {
  44.          if(rand_move() == 0)
  45.          {
  46.             f = 1;
  47.          }
  48.       }
  49.    }
  50. }
  51. if(f)
  52. {
  53.    gotoAndStop("over");
  54. }
  55. else
  56. {
  57.    mcCat.start_jump(catdir);
  58. }
  59.